import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2023 —10 —04
 * Time: 9:13
 */
public class test_10_04 {


    /*
    public static void num(int x) {
        if (x < 10) {
            System.out.println(x % 10);
        return;
        }
        num(x / 10);
        System.out.println(x % 10);//wc 真的难还好有debug
        return;
    }

    public static void main(String[] args) {

        num(1234);
    }
    */


    public static int sum(int x){
        int sum = 0;
        if( x > 0){
           int a = sum(x / 10);
           sum += a;

        }
        return sum;
    }

    public static void main(String[] args) {
        sum(1234);
    }



}
